#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[]) {
  /* code */
  string s;
  string s1;
  while (cin >> s) {
    s1 += s;
    cout << s1 << endl;
  }
  while (getline(cin, s)) {
    s1 = s + s1 + " ";
    cout << s1 << endl;
  }

  return 0;
}
